export const state = () => ({
  locales: ['en', 'zh'],
  locale: 'en',
  menuIndex: '-1',
  loginShow: false,
  isLogin: false
})

export const mutations = {
  SET_LANG (state, locale) {
    if (state.locales.includes(locale)) {
      state.locale = locale
    }
  },
  SET_MENU_INDEX (state, index) {
    state.menuIndex = index
  },
  SET_LOGIN_SHOW (state, show) {
    console.log(show)
    state.loginShow = show
  },
  SET_LOGIN_STATE (state, isLogin) {
    state.isLogin = isLogin
  }
}
